Skip to content

fix: Move folder cleanup and orphaned worktree pruning to main process#1541

Merged
charlesvien merged 3 commits intomainfrom
04-07-folder_logic_cleanup
Apr 8, 2026
Merged

fix: Move folder cleanup and orphaned worktree pruning to main process#1541
charlesvien merged 3 commits intomainfrom
04-07-folder_logic_cleanup

Conversation

@charlesvien
Copy link
Copy Markdown
Member

@charlesvien charlesvien commented Apr 8, 2026

Problem

Folder cleanup logic (removing deleted folders, pruning orphaned worktrees) ran in the renderer via useEffect.

Changes

  1. Move deleted-folder removal and orphaned worktree cleanup into FoldersService.initialize
  2. Remove cleanupOrphanedWorktrees tRPC endpoint and associated schemas
  3. Simplify useFolders hook by removing the init-on-mount side effect
  4. Change cleanupOrphanedWorktrees return type to void (result was unused)

How did you test this?

Manually

@charlesvien charlesvien changed the title Move folder cleanup and orphaned worktree pruning to FoldersService.initialize fix: Reduce unnecessary IPC calls causing UI unresponsiveness Apr 8, 2026
@charlesvien charlesvien changed the title fix: Reduce unnecessary IPC calls causing UI unresponsiveness fix: Move folder cleanup and orphaned worktree pruning to main process Apr 8, 2026
@charlesvien charlesvien marked this pull request as ready for review April 8, 2026 02:04
@charlesvien charlesvien force-pushed the 04-07-show_edit_instead_of_create_in_permission_prompt_for_existing_files branch from 4b8f8a8 to d1da956 Compare April 8, 2026 22:55
@charlesvien charlesvien force-pushed the 04-07-folder_logic_cleanup branch from 1f79a26 to 9cca63e Compare April 8, 2026 22:56
Copy link
Copy Markdown
Member Author

charlesvien commented Apr 8, 2026

Merge activity

  • Apr 8, 11:25 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 8, 11:34 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 8, 11:40 PM UTC: @charlesvien merged this pull request with Graphite.

@charlesvien charlesvien changed the base branch from 04-07-show_edit_instead_of_create_in_permission_prompt_for_existing_files to graphite-base/1541 April 8, 2026 23:26
@charlesvien charlesvien changed the base branch from graphite-base/1541 to main April 8, 2026 23:33
@charlesvien charlesvien force-pushed the 04-07-folder_logic_cleanup branch from 9cca63e to 6efaa2a Compare April 8, 2026 23:34
@charlesvien charlesvien merged commit 7a42ee6 into main Apr 8, 2026
16 checks passed
@charlesvien charlesvien deleted the 04-07-folder_logic_cleanup branch April 8, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants